package ink.xiaobaibai.common;

import lombok.Data;

/**
 * @description: 服务层返回结果
 * @author: 小白白
 * @create: 2021-05-31
 **/

@Data
public class ServiceResult {

    private ServiceResult() {
        this.isOk = true;
    }

    private ServiceResult(String msg) {
        this.msg = msg;
    }

    private boolean isOk;

    private String msg;

    @Override
    public String toString() {
        return this.msg;
    }

    public static ServiceResult ok() {
        return new ServiceResult();
    }

    public static ServiceResult fail(String msg) {
        return new ServiceResult(msg);
    }

}
